﻿using Basic.HrCollect;
using Basic.HrLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.HrLocalEvent.Emp
{
    [LocalEventName("Delete")]
    internal class ClearEmpPost : IEventHandler<EmpLocalEvent>
    {
        private readonly IEmpPostCollect _EmpPost;

        public ClearEmpPost(IEmpPostCollect empPost)
        {
            this._EmpPost = empPost;
        }

        public void HandleEvent(EmpLocalEvent data, string eventName)
        {
            this._EmpPost.Clear(data.Emp.EmpId);
        }
    }
}
